package com.cedric.yixianpai.game.cards.Sects.swordCards.d_YuanYing;

import com.cedric.yixianpai.game.Constants.CardType;
import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ShuiYueJianZhen extends SwordCard {
    private int turn=0;//效果生效轮数
    /**
     * title:水月剑阵
     * effect:防+10/14/18 回合开始防不减半 持续3/4/5回合
     */
    public ShuiYueJianZhen(@Value("1") int lvl) {
        super("水月剑阵");
        this.setLevel(lvl);
        this.setPeriod(Period.YUANYING);
        this.setDescription("防+10/14/18 回合开始防不减半 持续3/4/5回合");
        this.setCardType(CardType.ZHEN);
        if (1 == lvl) {
            this.setShield(10);
            this.turn=3;
        } else if (2 == lvl) {
            this.setShield(14);
            this.turn=4;
        } else if (3 == lvl) {
            this.setShield(18);
            this.turn=5;
        } else {
            throw new RuntimeException("Card Level Error!");
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        Sta1.getPlayerBuff().addShield(this.getShield());
        Sta1.getPlayerBuff().addShieldKeep(this.turn);
        return true;
    }
}
